package com.coderlin.mapper;

import com.coderlin.entities.Customer;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <Description> <br>
 *
 * @author Coder_Lin<br>
 * @version 1.0<br>
 * @taskId: <br>
 * @createDate 2021/07/22 13:33 <br>
 * @see com.coderlin.mapper <br>
 */
public interface CustomerMapper {

    /**
     * Mapper层接口用来做数据库与实体层的映射
     *
     * @return:List<Customer></>
     */
    List<Customer> listCustomer();

    /**
     *
     * @return:List<Customer></>
     */
    List<Customer> searchCustomer(@Param("userName") String userName);

    /**
     * 根据id查找Customer
     * @param cid
     * @return
     */
    Customer searchCustomerById(@Param("cid") int cid);


    /**
     * 添加用户
     * @param customer
     * @return
     */
    Integer addCustomer(@Param("customer") Customer customer);

    /**
     * 根据id删除
     * @param cid
     * @return
     */
    Integer delCustomerById(@Param("cid") int cid);

    /**
     * 根据customer更改数据
     * @param customer
     * @return
     */
    Integer modCustomer(@Param("customer") Customer customer);

}
